<template>
  <div class="shareItem">
    <h3 class="title van-ellipsis" v-html="info.title" @click="goInfo"></h3>
    <div class="txt van-multi-ellipsis--l2" @click="goInfo">
      {{ info.content }}
    </div>
    <div class="other">
      <img
        v-if="info.author.avatar"
        :src="$baseUrl + info.author.avatar"
        alt=""
        class="o1"
      />
      <img v-else src="@/assets/logo.png" alt="" class="o1" />
      <!-- 昵称 -->
      <div class="o2">{{ info.author.nickname }}</div>
      <!-- 时间 -->
      <div class="o3">{{ info.updated_at | formatTime }}</div>
      <div class="o4 iconfont">&#xe65b;</div>
      <!-- 阅读量 -->
      <div class="o5">{{ info.read }}</div>
      <div class="o6 iconfont">&#xe638;</div>
      <!-- 点赞量 -->
      <div class="o7">{{ info.star }}</div>
    </div>
  </div>
</template>

<script>
export default {
  props: ['info'],
  data () {
    return {}
  },
  methods: {
    goInfo () {
      this.$router.push(
        '/home/shareInfo/' + this.info.id + '?repath=' + this.$route.fullPath
      )
    }
  }
}
</script>

<style lang="less" scoped>
.shareItem {
  .title {
    font-size: 16px;
    font-family: PingFangSC, PingFangSC-Medium;
    font-weight: 500;
    text-align: left;
    color: #181a39;
    line-height: 22px;
    letter-spacing: 0px;
  }
  .txt {
    margin: 10px 0;
    font-size: 13px;
    font-family: PingFangSC, PingFangSC-Regular;
    font-weight: 400;
    text-align: left;
    color: #545671;
    line-height: 18px;
    letter-spacing: 0px;
  }
  .other {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #ccc;
    padding-bottom: 20px;
    .o1 {
      width: 22px;
      height: 22px;
      opacity: 1;
      border-radius: 50%;
    }
    .o2 {
      flex: 1;
      padding-left: 10px;
    }
    .o3 {
      padding-right: 21px;
    }
    .o4 {
      padding-right: 7px;
    }
    .o5 {
      padding-right: 23px;
    }
    .o6 {
      padding-right: 10px;
    }
    .o7 {
      padding-right: 20px;
    }
  }
}
</style>
